home *** CD-ROM | disk | FTP | other *** search
/ ShareWare OnLine 2 / ShareWare OnLine Volume 2 (CMS Software)(1993).iso / win1 / gethlp.zip / GETHELP.BAS < prev    next >
BASIC Source File  |  1993-04-02  |  3KB  |  76 lines

  1. '    Help engine declarations.
  2. '    Commands to pass WinHelp()
  3. '    calling convention for GetHelp
  4.  
  5. Global Const HELP_CONTEXT = &H1     ' Display topic identified by number in Data
  6. Global Const HELP_QUIT = &H2        ' Terminate help
  7. Global Const HELP_INDEX = &H3       ' Display index
  8. Global Const HELP_HELPONHELP = &H4  ' Display help on using help
  9. Global Const HELP_SETINDEX = &H5    ' Set an alternate Index for help file with more than one index
  10. Global Const HELP_KEY = &H101       ' Display topic for keyword in Data
  11. Global Const HELP_MULTIKEY = &H201  ' Lookup keyword in alternate table and display topic
  12.  
  13. Declare Function WinHelp Lib "User" (ByVal hWnd As Integer, ByVal lpHelpFile As String, ByVal wCommand As Integer, dwData As Any) As Integer
  14.  
  15. Type MultikeyHelp
  16.     mkSize As Integer
  17.     mkKeylist As String * 1
  18.     szKeyphrase As String * 253
  19. End Type
  20.  
  21. Global ThingsToDo As String
  22. Global HelpToGet As String
  23. Global KeyToGet As String
  24. Global char As String
  25.  
  26. Sub CloseWindow ()
  27.      End
  28. End Sub
  29.  
  30. Sub Main ()
  31.  
  32.      ThingsToDo = Command$
  33.  
  34.      If ThingsToDo = "" Then
  35.           HelpToGet = "winhelp.hlp"
  36.           KeyToGet = "help button"
  37.           Send_Message
  38.           GETHELP.Show
  39.           Exit Sub
  40.           End If
  41.  
  42.      For x% = 1 To Len(ThingsToDo)
  43.           char = Mid$(ThingsToDo, x%, 1)
  44.           If char = Chr$(47) And x% > 1 Then
  45.                HelpToGet = Mid$(ThingsToDo, 2, x% - 3) & ".hlp"
  46.                KeyToGet = Right$(ThingsToDo, Len(ThingsToDo) - x%)
  47.                Exit For
  48.                End If
  49.           Next x%
  50.  
  51.      GETHELP.Show
  52.  
  53. End Sub
  54.  
  55. Sub Send_Message ()
  56.  
  57.      msg$ = "GetHelp requires command line parameters.  After you have"
  58.      msg$ = msg$ & Chr$(10) & Chr$(13) & " situated the GetHelp icon in a Windows Group of your choice in Program Manager, select the File Menu, then Properties."
  59.      msg$ = msg$ & Chr$(10) & Chr$(13) & "You must add the parameters in the command line box after "
  60.      msg$ = msg$ & Chr$(10) & Chr$(13) & "GETHELP.EXE.  The two parameters must be preceded by a slash mark " & Chr$(34) & "/" & Chr$(34) & ".  For example:"
  61.      msg$ = msg$ & Chr$(10) & Chr$(13) & ""
  62.      msg$ = msg$ & Chr$(10) & Chr$(13) & "             GETHELP.EXE /WINHELP /HELP BUTTON"
  63.      msg$ = msg$ & Chr$(10) & Chr$(13) & ""
  64.      msg$ = msg$ & Chr$(10) & Chr$(13) & "The first parameter is the Help File you want to access, the second is a Key Word or Phrase from the Help File's Search Index.  Notice there's a space in the key phrase above."
  65.      msg$ = msg$ & Chr$(10) & Chr$(13) & "You must use the exact terminology as used in the Help Index."
  66.      msg$ = msg$ & Chr$(10) & Chr$(13) & ""
  67.      msg$ = msg$ & Chr$(10) & Chr$(13) & "We've included several Help Icons so you can differentiate between the Help files you're calling.  Just choose " & Chr$(34) & "change"
  68.      msg$ = msg$ & Chr$(10) & Chr$(13) & "icon" & Chr$(34) & " while you are setting up your command line parameters.  Then name your Icon by changing the Description field."
  69.      msg$ = msg$ & Chr$(10) & Chr$(13) & ""
  70.      msg$ = msg$ & Chr$(10) & Chr$(13) & "Enjoy!"
  71.           
  72.           MsgBox msg$, 64, "Micro-Bytes\WordWare"
  73.  
  74. End Sub
  75.  
  76.